<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="form/show/index.css">
    <link rel="stylesheet" href="form/show/FormMaking.css">
</head>
<body>
<div id="app">
    <fm-generate-form
            :data="jsonData"
            :remote="remoteFuncs"
            :value="editData"
            ref="generateForm"
    >
    </fm-generate-form>
<!--    <el-button type="primary" @click="handleSubmit">提交</el-button>-->
</div>
<script src="form/show/vue.js"></script>
<script src="form/show/index.js"></script>
<script src="form/show/FormMaking.umd.js"></script>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script>
    (function ($) {
        $.getUrlParam = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }
    })(jQuery);

    $(function () {
        //alert(window.location.href);
        var formKey = $.getUrlParam('formKey');
        var taskId = $.getUrlParam('taskId');

        $.ajax({
            type: 'POST',
            url: '/history/historyProcessVariabless?taskId=' + taskId,
            dataType: 'json',
            success: function (data) {
                var editData = data;
                $.ajax({
                    type: 'POST',
                    url: '/sys-forms/find?id=' + formKey,
                    dataType: 'json',
                    success: function (data) {
                        var jsonstr = eval(eval(data).data).formValue
                        new Vue({
                            el: '#app',
                            data: {
                                jsonData: JSON.parse(jsonstr),
                                editData: editData,
                                remoteFuncs: {}
                            },
                            methods: {}
                        })
                    },
                    error: function (data) {
                        // console.log(data.msg);
                    },
                });
            },
            error: function (data) {
                // console.log(data.msg);
            },
        });
    })
</script>
</body>
</html>
